<?php


//单例模式
class Site
{
    //属性
    public $siteName;
    //本类的静态实例
    protected static $instance = null;
    //禁用掉构造器
    private function __construct($siteName)
    {
        $this->siteName = $siteName;
    }

    //获取本类唯一实例
    public static function getInstance($siteName="小泥吧科技")
    {
        if(!self::$instance instanceof self){
            self::$instance = new self($siteName);
        }
        return self::$instance;
    }
}